package com.sgcc.pda.mdrh.zoom.plugin;

import android.os.Environment;

import java.io.File;

/**
 * 常量
 *
 * @author Ben
 * @version 2019.08.29
 */
public class Const {

    // 文件公共路径
    public static final String FILE_PATH_APP_LOC_DIR = Environment.getExternalStorageDirectory() + File.separator + "com.sgcc.pda.mdrh";
    public static final String FILE_PATH_DOWNLOAD = FILE_PATH_APP_LOC_DIR + "/download/";//下载目录
    public static final String FILE_SO_PATH_DOWNLOAD = FILE_PATH_APP_LOC_DIR + "/hz/";//so下载目录

    /**
     * 定义对外的broadcast描述
     */
    public static final String BROADCAST_PERMISSION_DISC = "com.sgcc.pda.permissions.COMM_BROADCAST";


    public static final String INTENT_ID = "INTENT_ID";
    public static final String INTENT_VALUE = "INTENT_VALUE";
    public static final String INTENT_SECTION_NO = "INTENT_SECTION_NO";

    //    public static final String ERR_REQUEST_APPMARKET_INFO = "获取应用市场列表失败";
    public static final String ERR_REQUEST_APPMARKET_INFO = "暂时没有可更新的应用";

    public static final String MSG_OPEN_NEED_UPDATE_FIRST = "请先在应用市场更新此应用！";
    public static final String MSG_APP_NO_INSTALL = "应用未安装，请先安装！";


    /**
     * APP(插件)安装状态码
     */
    public static class AppState {
        public final static int APP_STATES_NO_INSTALL = 0;//应用未安装
        public final static int APP_STATES_DOWNLOADED = 1;//应用下载未安装
        public final static int APP_STATES_INSTALLED = 2;//应用已经安装
        public final static int APP_STATES_NEED_UPDATE = 3;//应用需要强制更新
        public final static int APP_STATES_INSTALLED_DOWNLOADED = 4;//应用已安装已下载新版apk，但未安装
        public final static int APP_STATES_HAVE_NEW_VERSION = 5;//应用有新的版本
        public final static int APP_STATES_HAVE_NOW_VERSION = 6;//应用下载版本的apk没有删除
        public final static int APP_STATE_HAVE_ADD_VERSION = 7;//应用增量更新完毕,需要重启
    }

    /**
     * 下载状态
     */
    public static class DownloadState {
        public static final int DOWNLOAD_STATE_DEFAULT = 0;//下载状态 -默认
        public static final int DOWNLOAD_STATE_DOWNLOADING = 1;//下载状态 -下载中
        public static final int DOWNLOAD_STATE_DOWNLOADED = 2;//下载状态 -下载完成
        public static final int DOWNLOAD_STATE_FAIL = 3;//下载状态 -下载失败
    }
}
